<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;

class DrugsModel extends Model
{
    //药品表
    use HasFactory;
    public $table='drugs';
    protected $guarded=[];

    public static function getList(){
        return self::paginate(10);
    }

    public static function postCreate($data){
        return self::create($data);
    }

    /**
     * @param $param
     * @return mixed
     * 添加
     * ww
     */
    public static function addDoctor($param)
    {
        return self::create($param);
    }

    /**
     * @param $param
     * @return mixed
     * 删除
     * ww
     */
    public static function delDoctor($id)
    {
        return self::destroy($id);
    }

    /**
     * @param $param
     * @return mixed
     * 列表
     * ww
     */
    public static function listDoctor()
    {
        return self::paginate(10);
    }

    /**
     * @param $param
     * @return mixed
     * 修改
     * ww
     */
    public static function updateDoctor($id, $param)
    {
        return self::where('id',$id)->update($param);
    }
}
